package cn.wendellup.bootStrap.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.egame.common.exception.ExceptionCommonBase;
import cn.wendellup.bootStrap.service.contract.IUserService;
import cn.wendellup.bootStrap.valueobject.entity.UserInfo;
import cn.wendellup.bootStrap.valueobject.vo.BigVO;

@Controller
@RequestMapping(value="/json")
public class JsonController {
	@Autowired
	private IUserService userService;
	
	@RequestMapping(value = "/listUser")
	@ResponseBody
	public Object listUserJson(HttpServletRequest request, HttpServletResponse
			response) throws ExceptionCommonBase{
		List<UserInfo> userList = userService.listUsers();
		BigVO bigVo = new BigVO();
		bigVo.setUserList(userList);
		bigVo.setCode(1);
		bigVo.setSuccess("success");
		return bigVo;
	}
}
